Attempting to export a class and use as an extention for another class.. I've even tried module.export at the bottom and export class at the top. What am I doing wrong? Also tried changing to .mjs
File: -animal.js -dog.js -test.js
animal.js:
class Animal {
....
}
export {Animal}
dog.js:
import {Animal} from 'animal.js';
class Dog extends Animal{
...
}
There's not much setup details to go on, but one thing I noticed is your import path is absolute... which is generally reserved for node modules
import {Animal} from 'animal.js';
I'd expect it to be relative, more like
import {Animal} from '../animal';
or
import {Animal} from './animal';